const stack = [];

//入栈
stack.push(1);
stack.push(3);
stack.push(2);
stack.push(5);
stack.push(4);

// 访问栈顶元素
const peek = stack[stack.length-1];
console.log(peek);

//出栈
const pop = stack.pop();
console.log(pop);
// 栈的长度
const len = stack.length;
console.log(len);
//判断栈是否为空
const isEmpty = stack.length === 0;
console.log(isEmpty);
